﻿<!-- 继承公共文件 -->
<extend name="./Application/Admin/view/layout.html" />



      <block name="mid">
   
<div class="panel panel-danger">

                        <div class="panel-heading">
                           添加角色
                        </div>
                        <div class="panel-body">
                            <form role="form" action="" method="post" enctype="multipar/form-data">
                                         

                                 <!-- <div class="form-group">
                                            <label>导航层级 ：</label>
                                            <select name="pid">
                                            <option value="0">导航顶级</option>
                                            <foreach name="list" item="v">
                                            <option value="{$v.id}">{$v.name}</option>
                                            </foreach>
                                         
                                            </select>
                                        </div> -->
                                 <div class="form-group">
                                            <label>角色名称</label>
                                            <input type="text" class="form-control" name="title">
                                    
                                       
                                 
                                 <div class="form-group">
                                             <label>启用 ：</label>
                                            <input type="radio" checked name="status" value="1"> 启用

                                             <input type="radio" name="status" value="0"> 禁用
                                            
                                            
                                        </div>
                              
                               
                                 
                                        <button class="btn btn-info" type="submit">确定 </button>
                                          <div class="row">
                                              <div class="col-md-6">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            权限选择
                        </div>
                        <div class="panel-body">
                            <div id="accordion" class="panel-group">
                                <div class="panel panel-default">
                                <!-- 循环输出导航 -->
                                <foreach name="top_nav" key="k" item="v">
                                    <div class="panel-heading">
                                        <h4 class="panel-title">
                                            <a class="collapsed" href="#collapse{$k}" data-parent="#accordion" data-toggle="collapse">
                                            ------------------------------------------{$v.name}------------------------------------------
                                            </a>
                                        </h4>
                                    </div>
                                    <div style="height: 0px;" class="panel-collapse collapse" id="collapse{$k}">
                                        <div class="panel-body">
                                            <label>
                                            <input id="{$v.id}" value="{$v.id}" type="checkbox" name="rules[]">
                                            {$v.name}
                                            </label>
                                            <br>
                                            
                                            <!-- 循环输出权限表 -->
                                            <foreach name="rule" item="vo">

                                            <eq name="v['id']" value="$vo.pid" >
                                            <label>
                                            <input id="{$vo.id}" value="{$vo.id}" type="checkbox" name="rules[]">
                                             - {$vo.title}
                                             </label>
                                            </eq>
                                            </foreach>
                                        </div>
                                    </div>
                                    </foreach>
                                </div>
                                
                               
                            </div>
                        </div>
                           


                    </div>
                </div>
                                          </div>
                                    </form>
                            </div>
                        </div>




<block name="js">


<script type="text/javascript" src="__ADMIN__assets/js/jquery-3.0.0.min.js"></script>
<script type="text/javascript">
$(function(){

     

    $('.text-center i').click(function(){
      var icon = $(this).text();
      $('.icon').val(icon);

    })



})



</script>

</block>













